import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Location } from '@angular/common';

@Component({
  selector: 'app-basic-database',
  templateUrl: './basic-database.component.html',
  styleUrls: ['./basic-database.component.scss']
})
export class BasicDatabaseComponent implements OnInit {
  state: string;
  constructor(private router: Router, private location: Location) { }
  /**
	 * @description 跳转路由
	 * @param route 要跳转的路由
	 */
  goToRoute(route: any) {
    this.router.navigate([route]);
  }
  ngOnInit() {
    this.state = this.location.path();
    this.router.events.subscribe(event => {
      this.state = this.location.path();
    });

  }

}
